package com.hong.decorator;

import com.hong.aop.Greeting;

/**
 * 具体装饰器,实现类似AOP中的后置增强效果
 */
public class AfterGreetingDecorator extends AbstractGreetingDecorator {

    public AfterGreetingDecorator(Greeting greeting) {
        super(greeting);
    }

    @Override
    public void sayHello(String name) {
        super.sayHello(name);
        after();
    }

    private void after() {
        System.out.println("after");
    }
}
